Microsoft CodeView and Utilities
================================

CHAPTER 3 ___ USING DIALOG COMMANDS

CodeView dialog commands can be used in sequential mode or from the dialog
window.  In sequential mode, they are the primary method of entering commands.
In window mode, dialog commands are used to enter commands that require
arguments or that do not have corresponding window commands.

Many window commands have duplicate dialog commands.  Generally, the window
version of a command is more convenient, but the dialog version is more
powerful.  For example, to set a breakpoint on a source line in window mode,
put the cursor in the source line and press F9, or point to the line and click
th eleft mouse button.  The dialog version of the Breakpoint command (BP)
requires more keystrokes, but it allows you to specify an address, a pass
count, and a string of commands to be taken whenever the breakpoint is encoun-
tered.

The rest of this chapter explains how ot enter dialog commands.
3.1  Entering Commands and Arguments

Dialog commands are entered at the CodeView prompt (>).  Type the command and
arguments, and then press the ENTER key.

In window mode, you can enter commands whether or not the cursor is at the
CodeView prompt.  If the cursor is in the dialog window, the text you type
will appear after the prompt in the dialog window, even though the cursor
remains in the display window.

3.1.1  Using Special Keys

When entering kialog commands or viewing output from commands, you can use the
following special keys:
Key            Action
---------------------
CONTROL+C      Stops the current output or cancels the current command line.
               For example, if you are watching a long display from a Dump
               command, you can press CONTROL+C to interrupt the output and
               return to the CodeView prompt.  If you make a mistake while
               entering a command, you can press CONTROL+C to cancel the
               command without executing it.  A new prompt appears, and you
               can reenter the command.
CONTROL+S      Pauses during output of a command.  You can press any key to
               continue output.  For example, if you are watching a long
               display from a Dump command, you can press CONTROL+S when a
               part of the display appears that you want to examine more
               closely.  Then press any key when you are readyi for the
               output to continue scrolling.
BACKSPACE      Deletes the previous character on the command line and moves
               the cursor back one space.  For example, if you make an error
               while typing a command, you can use the BACKSPACE key to
               delete the characters back to the error--then retype the rest
               of the command.
3.1.2  Using the Command Buffer

In window mode, the CodeView debugger has a command buffer where the last 2-4
screens of commands and command output are stored.  The command buffer is not
available in sequential mode.

When the cursor is in the dialog window, you can scroll up or down to view
the commands you have entered earlier in the session.  The commands for moving
the cursor and scrolling through the buffer are explained in sections 2.1.1.1
and 2.1.2.1.

Scrolling through the buffer is particularly useful for viewing the output
from commands, such as Dump or Examine Symbols, whose output may scroll off
the top of the dialog window.

If you have scrolled through the dialog buffer to look at previous commands
and output, you can still enter new commands.  When you type a command, it
will appear to be overwriting the previous line where the cursor is located,
but when you press the ENTER key, the new command will be entered at the end
of the buffer.  For example, if you enter a command while the cursor is at the
start of the buffer and then scroll to the end of the buffer, you will see the
command you just entered.  If you scrill back to the point where you entered
the command, youwill see the original characters you typed over the originals.

When you start the debugger, the buffer is empty except for the copyright
message.  As you enter commands during the session, the bugger is gradually
filled from the bottom to the top.  If you have not filled the entire buffer
and you press the HOME key to go to the top of the buffer, you will not see
the first commands of the session.  Instead you will see blank lines, since
there is nothing at the top of the buffer.

3.2  Format for CodeView Commands and Arguments

The CodeView command format is similar to the format of previous Microsoft
debuggers, SYMDEB and DEBUG.  However, some features, particularly operators
and expressions, are different.  The general format for CodeView commands is
shown below:

command [arguments] [;command2]

The command is a one-, two-, or three-character command name, and arguments
are expressions that represent values or addresses to be used by the command.
The command is not case sensitive; any combination of uppercase and lowercase
letters can be used.  However, arguments consisting of source-level express-
ions may or may not be case sensitive. (For example, C expressions are
normally case sensitive; FORTRAN expressions are not.  Case sensitivity can be
affected by the language selected for expression evaluation, in the Options
menu.)  Usually, the first argument can be placed immediately after command
with no space separating the two fields.

The number of arguments required or allowed with each command varies.  If a
command takes two or more arguments, you must separate the arguments with
spaces.  A semicolon (;) can be used as a command separator if you want to
specify more than one command on a line.
<*>  Examples

>DB 100 200     ;* Example 1

>U Label1       ;* Example 2, C variable as argument

>U SUM          ;* Example 3, FORTRAN variable as argument

>U SUM; DB      ;* Example 4, multiple commands

In Example 1, DB is the first command (for the Dump Bytes command).  The
arguments to the command are 100 and 200.  The second command on this line is
the Comment command (*).  A semicolon is used to separate the two commands.
The Comment command is used throughout the rest of the manual to number
examples.

In Example 2, U is the first command (for the Unassemble command), and the C
language variable Label1 is a command argument.  In Example 3, U is again the
first command (for the Unassemble command), and the FORTRAN variable SUM is a
command argument.

Example 4 consists of three commands separated by semicolons.  The first is
the Unassemble command (U) with the FORTRAN variable SUM as an argument.  The
second is the Dump Bytes command (DB) with no arguments.  The third is the
Comment command (*).

 .end of chapter.